openl:generate

Full name:

org.openl.rules:openl-maven-plugin:5.19.1:generate

Description:

Generate OpenL interface, domain classes, project descriptor and unit tests

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • Binds by default to the lifecycle phase: generate-sources.

Optional Parameters

Name Type Since Description
classpaths String[] - Deprecated. Obsolete. No needs to generate rules.xml from Maven.
createProjectDescriptor boolean - Deprecated. Obsolete. No needs to generate rules.xml from Maven.
Default value is: true.
generateInterfaces GenerateInterface[] - Deprecated. Obsolete. Replaced with the smart generator. Use interfaceClass instead.
generateUnitTests Boolean - Deprecated. Obsolete. Use openl:test goal to run OpenL tests.
Default value is: false.
interfaceClass String - A generated Java interface from an OpenL project. If it is empty then generation will be skipped.
isProvideRuntimeContext boolean - Add IRulesRuntimeContext arguments to the generated interface.
isProvideVariations boolean - Add additional methods to the generated interface to support variations.
openlResourcesDirectory String - Deprecated. Use sourceDirectory instead.
outputDirectory File - An output directory of generated Java beans and OpenL java interface.
Default value is: ${project.build.directory}/generated-sources/openl.
overwriteProjectDescriptor boolean - Deprecated. Obsolete. No needs to generate rules.xml from Maven.
Default value is: true.
overwriteUnitTests Boolean - Deprecated. Obsolete. Use openl:test goal to run OpenL tests.
Default value is: false.
projectName String - Deprecated. Obsolete. No needs to generate rules.xml from Maven.
sourceDirectory File - Folder that contains all OpenL-related resources (OpenL rules, project descriptor etc.). For example: "${project.basedir}/src/main/openl".
Default value is: ${project.build.sourceDirectory}/../openl.
superInterface String - Comma-separated list of interfaces which are used for extending of the generated interface.
unitTestTemplatePath String - Deprecated. Obsolete. Use openl:test goal to run OpenL tests.
Default value is: org/openl/rules/maven/JUnitTestTemplate.vm.

Parameter Details

classpaths:

Deprecated. Obsolete. No needs to generate rules.xml from Maven.
Default classpath entries in rules.xml. Default value is {"."} Used only if createProjectDescriptor == true.
  • Type: java.lang.String[]
  • Required: No

createProjectDescriptor:

Deprecated. Obsolete. No needs to generate rules.xml from Maven.
If true, rules.xml will be generated if it doesn't exist. If false, rules.xml will not be generated. Default value is "true".
  • Type: boolean
  • Required: No
  • Default: true

generateInterfaces:

Deprecated. Obsolete. Replaced with the smart generator. Use interfaceClass instead.
Tasks that will generate classes or data type.

Object Properties

Name Type Required Description
srcFile String false *Reference to the Excel file for which an interface class must be generated.
targetClass String false *Full name of the interface class to be generated. Optional; if missed interface not generated. OpenL Tablets WebStudio recognizes modules in projects by interface classes and uses their names in the user interface. If there are multiple wrappers with identical names, only one of them is recognized as a module in OpenL Tablets WebStudio.
isUsedRuleXmlForGenerate boolean (true/false) false *Should system generate class and datatypes from rules.xml. If yes srcFile ignored; targetClass is required.
displayName String false *End user oriented title of the file that appears in OpenL Tablets WebStudio. Default value is Excel file name without extension.
targetSrcDir String false *Folder where the generated interface class must be placed. For example: "src/main/java". Default value is: "${project.build.sourceDirectory}"
openlName String false *OpenL configuration to be used. For OpenL Tablets, the following value must always be used: org.openl.xls. Default value is: "org.openl.xls"
userHome String false *Location of user-defined resources relative to the current OpenL Tablets project. Default value is: "."
userClassPath String false *Reference to the folder with additional compiled classes imported by the module when the interface is generated. Default value is: null.
ignoreTestMethods boolean false *If true, test methods will not be added to interface class. Used only in GenerateInterface. Default value is: true.
generateUnitTests boolean false *Overwrites base generateUnitTests value
unitTestTemplatePath String false *Overwrites base unitTestTemplatePath value
overwriteUnitTests boolean false *Overwrites base overwriteUnitTests value
generateDataType boolean false *Generate or not dataType for current task.
  • Type: org.openl.rules.maven.gen.GenerateInterface[]
  • Required: No

generateUnitTests:

Deprecated. Obsolete. Use openl:test goal to run OpenL tests.
If true, JUnit tests for OpenL Tablets Test tables will be generated. Default value is "false"
  • Type: java.lang.Boolean
  • Required: No
  • Default: false

interfaceClass:

A generated Java interface from an OpenL project. If it is empty then generation will be skipped.
  • Type: java.lang.String
  • Required: No

isProvideRuntimeContext:

Add IRulesRuntimeContext arguments to the generated interface.
  • Type: boolean
  • Required: No

isProvideVariations:

Add additional methods to the generated interface to support variations.
  • Type: boolean
  • Required: No

openlResourcesDirectory:

Deprecated. Use sourceDirectory instead.
(no description)
  • Type: java.lang.String
  • Required: No

outputDirectory:

An output directory of generated Java beans and OpenL java interface.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/generated-sources/openl

overwriteProjectDescriptor:

Deprecated. Obsolete. No needs to generate rules.xml from Maven.
If true, rules.xml will be overwritten on each run. If false, rules.xml generation will be skipped if it exists. Makes sense only if createProjectDescriptor == true. Default value is "true".
  • Type: boolean
  • Required: No
  • Default: true

overwriteUnitTests:

Deprecated. Obsolete. Use openl:test goal to run OpenL tests.
If true, existing JUnit tests will be overwritten. If false, only absent tests will be generated, others will be skipped.
  • Type: java.lang.Boolean
  • Required: No
  • Default: false

projectName:

Deprecated. Obsolete. No needs to generate rules.xml from Maven.
Default project name in rules.xml. If omitted, the name of the first module in the project is used. Used only if createProjectDescriptor == true.
  • Type: java.lang.String
  • Required: No

sourceDirectory:

Folder that contains all OpenL-related resources (OpenL rules, project descriptor etc.). For example: "${project.basedir}/src/main/openl".
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.sourceDirectory}/../openl

superInterface:

Comma-separated list of interfaces which are used for extending of the generated interface.
  • Type: java.lang.String
  • Required: No

unitTestTemplatePath:

Deprecated. Obsolete. Use openl:test goal to run OpenL tests.
Path to Velocity template for generated unit tests. If omitted, default template will be used. Available in template variables:
Name Description
openlInterfacePackage Package of generated interface class
openlInterfaceClass Generated interface class name
testMethodNames Available test method names
projectRoot Root directory of OpenL project
srcFile Reference to the Excel file for which an interface class must be generated.
StringUtils Apache commons utility class
  • Type: java.lang.String
  • Required: No
  • Default: org/openl/rules/maven/JUnitTestTemplate.vm